#ifndef _VIEW_H_
#define _VIEW_H_

typedef void (*t_draw_func)(int, int, int, int);

struct SDL_Surface;

typedef struct Size {
    int width;
    int height;
} Size;

typedef struct Position {
    int x;
    int y;
} Position;

typedef struct View {
    Size window;
    Size cell;
    Size view; /* N, L - size in cells */

    Position offset;
    Position mouse_select;
    Position first_cell; /* I, J - cell on top left */
    Position first_cell_offset; /* offset of cell on top left */
    char *cell_buffer;
} View;

int InMouseSelect(int x, int y);

void InitView();
void InitCell(SDL_Surface*);
void DestroyCell();
void GetMapPos(int* x, int* y, int mouse_x, int mouse_y);
void DrawView();

void MoveView(int deltax, int deltay);

#endif
